<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:job="livcos.org/ns/process/job"
  xmlns:c="livcos.org/ns/cosmos"
  xmlns:u="livcos.org/ns/cosmos/update"
  exclude-result-prefixes="c">
  
  <xsl:import href="../../../style/base.xsl"/>
  
  <xsl:param name="domain"/>
  <xsl:param name="name"/>
  <xsl:param name="title"/>
  
  <xsl:template match="/">
    <job:copy ref="tmpl/data/Intro" target="/{$domain}/{$name}/data/Intro" scope="view">
      <job:param name="domain" value="{$domain}"/>
      <job:param name="name" value="{$name}"/>
      <job:param name="title" value="{$title}"/>
    </job:copy>
    <job:copy ref="tmpl/data/map/home" target="/{$domain}/{$name}/data/map/home" scope="view">
      <job:param name="domain" value="{$domain}"/>
      <job:param name="name" value="{$name}"/>
      <job:param name="title" value="{$title}"/>
    </job:copy>
    <job:copy ref="tmpl/web" target="/{$domain}/{$name}/web"/>
    <xsl:variable name="url" select="concat($toRootPath, '/', $domain, '/', $name, '/web/Intro.html')"/>
    <job:feed stream="response" base="job" content-type="text/html">
      <html>
        <body>
          <p>Redirecting to <a href="{$url}"><xsl:value-of select="$url"/></a>...</p>
          <script type="text/javascript">
            <xsl:text>document.location.replace('</xsl:text>
            <xsl:value-of select="$url"/>
            <xsl:text>');</xsl:text>
          </script>
        </body>
      </html>
    </job:feed>
  </xsl:template>
  
</xsl:stylesheet>
